<template>
	<div>
		<aplid-base-crud v-show="!visible" ref="crud" class="w-100" v-bind="baseConfig">
			<template v-slot:menuColumn="{ row }">
				<el-button type="primary" text @click="handleOperate('detail', row, '查看详情')">查看详情</el-button>
			</template>
		</aplid-base-crud>

		<div class="deail" v-show="visible">
			<el-page-header @back="goBack">
				<template #content>
					<span class="text-large font-600 mr-3"> 详情 </span>
				</template>
			</el-page-header>
			<DetailPage class="mt10" v-bind="detailConfig" :model="nowRowData"></DetailPage>
		</div>
	</div>
</template>

<script setup lang="ts">
import DetailPage from '@/views/aplid/DetailPage/index.vue'

const rowData: any = inject('nowRowData')
const nowRowData = ref({})
const visible = ref(false)
const baseConfig = {
	pageName: '就职记录',
	dictcodes: ['ORG_TYPE', 'ORG_LEVEL'],
	rowKey: 'roleId',
	api: {
		index: 'view_dpPractitionersExperience_page',
	},
	auth: {
		index: 'view_dpPractitionersExperience_page',
	},
	paramsObj: {
		idCard: rowData.idCard,
	},
	menuBtn: [],
	tableConfig: {
		stripe: true,
		border: false,
		tableLayout: 'auto',
		columns: [
			{
				label: '所在城市',
				prop: 'city',
			},
			{
				label: '就职服务组织',
				prop: 'belongUnit',
			},
			{
				label: '服务人员聘用方式',
				prop: 'hireModeLabel',
			},
			{
				label: '职业类型',
				prop: 'jobTypeLabel',
			},
			{
				label: '入职日期',
				prop: 'entryDate',
			},
			{
				label: '劳务合同',
				prop: 'laborContract',
				custome:'file',
				width:150,
			},
			{
				label: '离职/退休日期',
				prop: 'dimissionDate',
			},
			{
				label: '离职证明',
				prop: 'dimissionProve',
				custome:'file',
				width:150,
			},
			
			{
				label: '操作',
				prop: 'menu',
				width: 300,
				fixed: 'right',
			},
		],
	},
}

const detailConfig = {
	inline: false,
	labelPosition: 'left',
	column: [
		
		{ label: '所属单位', prop: 'belongUnit', span: 8 },
		{
			label: '所在城市',
			prop: 'city',
			span: 8,
		},
		// {
		// 	label: '所属部门名称',
		// 	prop: 'departmentName',
		// 	span: 8,
		// },
		{ label: '所属单位统一信用代码', prop: 'creditCode', span: 8 },
		{
			label: '参加工作日期',
			prop: 'workDate',
			span: 8,
		},
		{ label: '人员聘用方式', prop: 'hireModeLabel', span: 8 },
		
		{
			label: '岗位类型',
			prop: 'postType',
			propName: 'postTypeLabel',
			code: 'POSITION_TYPE',
			span: 8,
		},
		{
			label: '职业类型',
			prop: 'jobType',
			propName: 'jobTypeLabel',
			code: 'OCCUPATION_TYPE',
			span: 8,
		},
		{ label: '其他岗位类型名称', prop: 'otherPost', span: 8 },
		{ label: '入职日期', prop: 'entryDate', span: 8 },
		{
			label: '劳务合同',
			prop: 'laborContract',
			type: 'upload',
			span:24,
		},
		{ label: '离职/退休日期', prop: 'dimissionDate', span: 8 },
		{ label: '离职原因说明', prop: 'dimissionCause', span: 8 },
		{
			label: '离职证明',
			prop: 'dimissionProve',
			type: 'upload',
			span: 24,
		},
		// { label: '工作内容', prop: 'workContent', span: 24 },
	],
}

const handleOperate = (type, row, title) => {
	nowRowData.value = row
	visible.value = true
}

const goBack = () => {
	visible.value = false
}
</script>

<style scoped></style>
